<template>
	<view class="container">
		<view v-for="(item,index) in data.data" :key="index" class="info_pre">
			<view>
				<image src="/static/image/xianxi.png" mode="aspectFit"></image>
			</view>
			<view>
				<text>{{item.content}}</text>
				<br>
				<text>{{item.sendTime}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: {
					data:[]
				},
			}
		},
		onLoad() { 
			this.news()
		},
		methods: {
			async news() {
				const res = await this.$myRequest({
					url: '/api-msg/messages/',
					method: "get",
				})
				if (res.success == true) {
					this.data = res.data
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.info_pre {
		margin: 4% 10%;
		border: 1px solid #e1e1e1;
		box-shadow: 1px 1px 10px #9eaeb5;
		background-color: white;
		border-radius: 8px;
		display: flex;
		align-items: center;

		view:nth-child(1) {
			width: 17%;
			height: 50rpx;
			display: inline-block;
			vertical-align: middle;
			align-items: center;
			image{
			  width: 100%;
			  height: 50rpx;
			}
			image {
				width: 100%;
				height: 50rpx;
				// border-right: 1px solid #cccccc;
			}
		}
		view:nth-child(2) {
			width: 78%;
			display: block;
			padding: 2% 0;
			font-size: 28rpx;
			font-weight: bold;
			text:nth-child(1){
				width: 100%;
			}
			text:nth-child(3){
				width: 100%;
				font-size: 18rpx;
				font-weight: bold;
				color: #a6a6a6;
			}
		}
	}
</style>